Fix potential segmentation faults with exif. (#639)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 28 Aug 2020 11:50:07 +0000 (05:50 -0600)
committerGitHub <noreply@github.com>
Fri, 28 Aug 2020 11:50:07 +0000 (05:50 -0600)
commit0f563cc08e92e3d762ff8d072a4fa5c782ece8e7
tree855910f626c409a2a4ac8b3a0718cc6e2795510d
parent51c837e046d8ce4804e07f2c183ebfd20122b77e
Fix potential segmentation faults with exif. (#639)

1. A pointer exif_app_ to an ExifApp on QList<ExifApp> exif_apps was saved.
After this the list was modified.  This can lead to the saved pointer becoming
invalid.
2. The ExifApp structure had a dtor, but no other special functions, i.e.  it
violated the rule of 3 and the rule of 5.  Operations on QList<ExifApp> may
cause an ExifApp on the list to be copied or destroyed.  If an ExifApp is
destroyed, then the ExifApp dtor would close the files, even though there could
be a copy of the ExifApp expecting the files still to be open.

This scenerio occured with Qt6, causing segmentation faults in exif.test.
exif.cc